package com.twu.biblioteca;

import java.io.BufferedReader;
import java.io.IOException;

/**
 * Created by archoud on 3/10/14.
 */
public class Input {
    private BufferedReader reader;

    public Input(BufferedReader reader) {

        this.reader = reader;
    }

    public int getUserChoice() {
        String userChoiceText;
        int userChoice = 0;
        try {
            userChoiceText = reader.readLine();
            userChoice = Integer.parseInt(userChoiceText);
            userChoice -= 1;
        } catch (IOException e) {
            e.printStackTrace();
        }
        return userChoice;
    }
}
